package com.dc.refactoring._6_处理概括关系._10_FormTemplateMethod.step3;

import com.dc.refactoring._0_入门.Rental;

public class TextStatement extends Statement {


    @Override
    public String headerString(Customer customer) {
        return customer.getName() + "的租赁记录信息为：\n";
    }

    @Override
    public String eachRentalString(Rental rental) {
        return "\t" + rental.getMovie().getTitle() + "\t" + rental.getCharge() + "\n";
    }

    @Override
    public String footerString(Customer customer) {
        return  "总金额为：" + customer.getTotalCharge() + "\n"
                + "你获得的积分为：" + customer.getTotalFrequentRenterPoints() + "\n";
    }

}
